{**
 * block.tpl
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Common site sidebar menu -- user tools.
 *
 * $Id$
 {translate key="plugins.block.user.loggedInAs"}
 {if !$implicitAuth}
		<span class="blockTitle">{translate key="navigation.user"}</span>
	{/if}
 *}

<div class="block" id="sidebarUser">
	{if $isUserLoggedIn}
		
		<strong>{$loggedInUsername|escape}</strong>
		<ul>
			<!-- {if $hasOtherJournals}
				<li><a href="{url journal="index" page="user"}">{translate key="plugins.block.user.myJournals"}</a></li>
			{/if} -->
			<li><a href="{url page="user" op="profile"}">{translate key="plugins.block.user.myProfile"}</a></li>
			<li><a href="{url page="login" op="signOut"}">{translate key="plugins.block.user.logout"}</a></li>
			{if $userSession->getSessionVar('signedInAs')}
				<li><a href="{url page="login" op="signOutAsUser"}">{translate key="plugins.block.user.signOutAsUser"}</a></li>
			{/if}
		</ul>
	{else}
		{if $implicitAuth}	
			<a href="{url page="login" op="implicitAuthLogin"}">Journals Login</a>		
		{else}


			<form method="post" action="{$userBlockLoginUrl}">

			<strong>N&#259;m l&#224;m vi&#7879;c:</strong>
			{assign var=thisyear value=$smarty.now|date_format:"%Y"}
			{assign var=endYear value=$thisyear+20}
			<select name = "xNam">
			{section name=yearValue start=$thisyear-20 loop=$endYear step=1}
			{if $smarty.section.yearValue.index == 2014}
				<option selected = "selected">{$smarty.section.yearValue.index}</option>
			{else}
				<option>{$smarty.section.yearValue.index}</option>
			{/if}
			{/section}
			</select>

			<br> <br>
			<strong>&#272;&#417;n v&#7883;: </strong>


			<table>
				{assign var="cJournal" value=0}
				{iterate from=journals item=journal}
				{if !$cJournal}
					{assign var="cJournal" value=$journal->getPath()}
				{/if}

				
				{if $journal->getPath() === $cJournal}
					{assign var="useLayoutEditors" value=1}
				{else}
					{assign var="useLayoutEditors" value=0}
				{/if}
		
				<tr valign="top">
					<td width="5%" class="label"><input type="radio" name="ma_dvcs" value="{$journal->getPath()|escape}" {if $useLayoutEditors} checked="checked"{/if} /></td>
					<td width="95%" class="value"><label for="useLayoutEditors-1">{$journal->getLocalizedTitle()|escape}</label></td>
				</tr>
				{/iterate}
					<tr height = 10px ></tr>
					<tr>
						<td colspan="2">
						<strong>Ng&#432;&#7901;i &#273;&#259;ng nh&#7853;p:</strong>
						</td>
						<td>
						</td>
					</tr>
					<tr>
						<td><label for="sidebar-username">{translate key="user.username"}</label></td>
						<td><input type="text" id="sidebar-username" name="username" value="" size="12" maxlength="32" class="textField" /></td>
					</tr>
					<tr>
						<td><label for="sidebar-password">{translate key="user.password"}</label></td>
						<td><input type="password" id="sidebar-password" name="password" value="{$password|escape}" size="12" maxlength="32" class="textField" /></td>
					</tr>
					<tr>
						<td colspan="2"><input type="checkbox" id="remember" name="remember" value="1" /> <label for="remember">{translate key="plugins.block.user.rememberMe"}</label></td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="{translate key="user.login"}" class="button" /></td>
					</tr>
				</table>
			</form>
		{/if}
	{/if}
</div>

